package Model;

import util.TicTacToe_Exception;
import util.player;

public class game {

	//variables
	board theboard;
	public player currentPlayer;
	player winner;
	
	
	//constructor
	public game(){
		
		initialize();
		
	}
	
	public void initialize(){
		
		theboard=new board();
		currentPlayer=player.X;
		winner=null;
		
	}
	public void printBoard(){
		
		theboard.printboard();
		
	}
	
	
	
	public void makeMove(int x, int y) throws TicTacToe_Exception{
		
		if(winner!=null){
			
			throw new TicTacToe_Exception("The game is over. Unable to make move");
			
		}
		
		
			theboard.makeMove(x, y,  currentPlayer);
			//code if move is successful
			if(currentPlayer==player.O){
				currentPlayer=player.X;
				
			}else if(currentPlayer==player.X){
				
				currentPlayer=player.O;
			}
			//evaluate win conditions
			
			
	}
	
	
	
}
